package com.nami.store.biz.friend.repository.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.nami.store.domain.FriendDO;
import com.nami.store.mapper.FriendMapper;
import com.nami.store.biz.friend.repository.FriendRepository;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 好友信息 服务实现类
 * </p>
 *
 * @author lbc
 * @since 2023-08-22
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class FriendServiceImpl implements FriendRepository {

    private final FriendMapper friendMapper;

    @Override
    public FriendDO getFriendInfo(String from, String to) {

        return friendMapper.selectOne(new LambdaQueryWrapper<FriendDO>().eq(FriendDO::getUserId, from).eq(FriendDO::getFriendUserId, to));
    }
}
